

Table14 = (
(210, 210, 420,    0.0, 0.0),
(298, 294, 493,    0.1, 0.2),
(386, 379, 567,    0.2, 0.4),
   
(474, 463, 640,    0.3, 0.6),
(562, 547, 713,    0.4, 0.8),
(650, 632, 787,    0.5, 1.0),
   
(738, 715, 860,    0.6, 1.2),
(826, 800, 933,    0.7, 1.4),
(914, None,1006,   0.8, 1.6),
   
(1002,None,1080,   0.9, 1.8),
(1090,None,1153,   1.0, 2.0),
(None,None,1226,   1.1, 2.2),

(None,None,1300,   1.2, 2.4)
)


def Table14_Process(pollution_class, 
              multiple_num, 
              voltage_type, 
              peak_voltage, 
              supply_voltage):
    
    if ((voltage_type==0)and(supply_voltage<=210)) or ((voltage_type==1)and(supply_voltage<=150)):
        if pollution_class <= 1:
            Vidx = 0
        else:
            Vidx = 1
    else:
        Vidx = 2
    
    if multiple_num == 0:
        ECidx = 3
    else:
        ECidx = 4

    for i in range(1, len(Table14)):
        if peak_voltage > Table14[i-1][Vidx] and peak_voltage <= Table14[i][Vidx]:
            ExtraElecClearance = Table14[i][ECidx]

    return ExtraElecClearance


